public class BinarySearch1 {
    public  static int binarysearchbasic(int[] a, int target) {
        int i = 0, j = a.length - 1;
        while (i <= j) {
            int m = (i + j) /2;
            if (target < a[m]) {
                j = m - 1;
            }
        }
        return -1;
    }
}
